package com.voe.callback;

public abstract class AudioDeviceObserver {

	public enum ErrorCode {
		kRecordingError(0), kPlayoutError(1);

		public static ErrorCode fromValue(int value) {
			for (int i=0;i<ErrorCode.values().length;i++) {
				if(ErrorCode.values()[i].getValue() == value)
					return ErrorCode.values()[i];
			}
			return null;
		}

		/**
		 * Constructor.
		 */
		private ErrorCode(int value) {
			this.value = value;
		}

		/**
		 * Get the value.
		 * 
		 * @return the value
		 */
		public int getValue() {
			return value;
		}

		private final int value;
	};

	public enum WarningCode {
		kRecordingWarning(0), kPlayoutWarning(1);

		public static WarningCode fromValue(int value) {
			for (int i=0;i<WarningCode.values().length;i++) {
				if(WarningCode.values()[i].getValue() == value)
					return WarningCode.values()[i];
			}
			return null;
		}

		/**
		 * Constructor.
		 */
		private WarningCode(int value) {
			this.value = value;
		}

		/**
		 * Get the value.
		 * 
		 * @return the value
		 */
		public int getValue() {
			return value;
		}

		private final int value;
	};

	protected abstract void onErrorIsReported(ErrorCode error);

	protected abstract void onWarningIsReported(WarningCode warning);
}
